import { apiFox } from "@/request/teachers";
// 获取教会列表
export const getTeacherList = () => {
  return apiFox({ url: "/getTeachersList", method: "get" });
};

// 获取机构树形结构数据
export const getMechanismTreeData = () => {
  return apiFox({ url: "/getMechanismData", method: "get" });
};
// 获取机构的人员
export const getSessionUser = (page: number, size: number) => {
  return apiFox({
    url: "/getSessionUser",
    method: "get",
    params: { page, size },
  });
};

import { http } from "@/utils/http";

enum api {
  session = "/api/api/v1/admin/democracy/congress/session",
}

export interface Session {
  createTime?: string;
  description: string;
  id?: string;
  isOpen?: number;
  number: string;
  term: string;
  year?: string;
}

export interface Params {
  current: number;
  isOpen?: number;
  number?: string;
  size: number;
  term?: string;
  year?: string;
}

export const createSession = (session: Session) => {
  return http.post(`${api.session}`, session);
};

export const editSession = (session: Session) => {
  return http.put(`${api.session}`, session);
};

export const getSessionAll = (params: Params) => {
  return http.get(`${api.session}`, params);
};

export const delSession = (ids: string[]) => {
  return http.delete(`${api.session}`, { ids });
};
